package com.codejoys.ssm.service.Impl;

import com.codejoys.ssm.dao.SchoolDao;
import com.codejoys.ssm.domain.Discipline;
import com.codejoys.ssm.domain.School;
import com.codejoys.ssm.mapper.DisciplineMapper;
import com.codejoys.ssm.service.DisciplineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DisciplinServiceImpl implements DisciplineService {

    @Autowired
    DisciplineMapper disciplineMapper;

    @Autowired
    SchoolDao schoolDao;

    @Override
    public List<Discipline> findBySchoolId(School school) {
        List<Discipline> disciplines = schoolDao.findBySchoolId(school);
        return disciplines;
    }

    @Override
    public List<School> findByDiscipline(Discipline discipline) {
        List<School> byDiscipline = schoolDao.findByDiscipline(discipline);
        return byDiscipline;
    }
}
